<template>
	<view class="infoDetail">
		<h3 class="title">{{infoDetailData.title}}</h3>
		<view class="mes">
			<text>发表时间：{{infoDetailData.add_time | formatDate}}</text>
			<text>浏览：{{infoDetailData.click}}</text>
		</view>
		<view class="content">
			<rich-text :nodes="infoDetailData.content"></rich-text>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id:0,
				infoDetailData:[]
			}
		},
		methods: {
			async getNewsDetail(){
				let res = await this.$myRequest({
					url:"/api/getnew/" + this.id
				})
				this.infoDetailData = res.data.message[0]
			}
		},
		onLoad(option) {
			this.id = option.id
			this.getNewsDetail()
		}
	}
</script>

<style lang="scss">
	page{
		height: 100%;
		width: 100%;
		background:#fff;
		.infoDetail{
			margin: 0 10rpx;
			.title{
				text-align: center;
				width: 710rpx;
				display: block;
				margin: 20rpx 0;
			}
			.mes{
				display: flex;
				justify-content: space-between;
				margin-bottom: 30rpx;
			}
		}
	}
</style>
